//
//  MenuItems.m
//  Coffee
//
//  Created by sabhanayagam b on 4/29/11.
//  Copyright 2011 Cognizant. All rights reserved.
//

#import "MenuItems.h"


@implementation MenuItems

+ (id)backButtonRenderTo:(id)target
{
	CCLabelTTF *backLabel = [CCLabelTTF labelWithString:@"Back" fontName:@"Marker Felt" fontSize:24];
	CCMenuItemLabel *back = [CCMenuItemLabel itemWithLabel:backLabel target:target selector:@selector(itemClickHandler:)];
	CCMenu *topMenu = [CCMenu menuWithItems: back, nil];
	topMenu.position = CGPointMake(24, 300);
	[topMenu setColor:ccBLACK];	
	return topMenu;
}

+ (id)backButtonWithSelector:(SEL)selector  target:(id)target
{
	CCLabelTTF *backLabel = [CCLabelTTF labelWithString:@"Back" fontName:@"Marker Felt" fontSize:24];
	CCMenuItemLabel *back = [CCMenuItemLabel itemWithLabel:backLabel target:target selector:selector];
	CCMenu *topMenu = [CCMenu menuWithItems: back, nil];
	topMenu.position = CGPointMake(24, 300);
	[topMenu setColor:ccBLACK];	
	return topMenu;
}

+ (id)buttonWithSelector:(SEL)selector target:(id)target  label:(NSString*)label
{
	CCLabelTTF *backLabel = [CCLabelTTF labelWithString:label fontName:@"Marker Felt" fontSize:24];
	CCMenuItemLabel *back = [CCMenuItemLabel itemWithLabel:backLabel target:target selector:selector];
	CCMenu *topMenu = [CCMenu menuWithItems: back, nil];
	topMenu.position = CGPointMake(30, 300);
	[topMenu setColor:ccBLACK];	
	return topMenu;
}

-(void) itemClickHandler: (id) sender
{
	[(CCMultiplexLayer*)parent_ switchTo:0];
	
}

@end
